<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .menu {
        display: flex;
        list-style: none;
        justify-content: center;
      }
      .menu li {
        margin: 0 10px;
        cursor: pointer;
      }
      .menu li.active {
        color: #f40;
      }
    </style>
  </head>
  <body>
    <ul class="menu">
      <li class="active">item1</li>
      <li>item2</li>
      <li>item3</li>
      <li>item4</li>
      <li>item5</li>
    </ul>
    <script>
      // 点击li时，切换active到被点击的li上
    </script>
  </body>
</html>

